/**
 * 
 */
package No1_100.No1_10.ReverseInteger_7;

/**
 * @author 李敬
 *
 */
public class Solution {

	public static int reverse(int x) {
		
		int max = 2147483647;  //int最大值  
        int min = -2147483648;  //int最小值  
		
		int result = 0;
		int flag = 0;
        if (x < 0) {
			x = -x;
			flag = -1;
		}
        while (x > 0) {
			int temp = x % 10;
			x = x / 10;
			result = result * 10 + temp;
		}
        if (x < 0) {
			return -1;
		}
        if (flag == -1) {
			result = -result;
		}
        return result;
    }
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println(Solution.reverse(1534236469));
	}

}
